package com.bianmaba.examples.mybatis;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;


/**
 * 继承SpringBootServletInitializer以支持打war包在tomcat中运行
 */
@SpringBootApplication
@MapperScan("com.bianmaba.examples.mybatis.mapper")
public class MyBatisExampleApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(MyBatisExampleApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(this.getClass());
    }

}
